<%@ page language="java" import="java.util.*"
	contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="sec"
	uri="http://www.springframework.org/security/tags"%>
<%
	ArrayList<String> jsPaths = new ArrayList<String>();
	jsPaths.add("/resources/bootstrap/assets/js/jquery.js");
	jsPaths.add("/resources/bootstrap/dist/js/bootstrap.min.js");
	jsPaths.add("/resources/bootstrap/validation/jquery.validate.min.js");
	jsPaths.add("/resources/custom/home/home.js");
	request.setAttribute("jsPaths", jsPaths);
	Object nav = request.getAttribute("nav");
	if (nav == null) {
		request.setAttribute("nav", "dashBoard");
	}
%>
<!DOCTYPE html>
<html>
<head>
<jsp:include page="common/header.jsp"></jsp:include>
<link
	href="${pageContext.request.contextPath}/resources/custom/home/home.css"
	rel="stylesheet">
</head>

<body>
	<script type="text/javascript">
		var nav = "${nav}";
		var basePath = "${pageContext.request.contextPath}/";
	</script>
	<div class="navbar navbar-inverse navbar-fixed-top" role="navigation">
		<div class="container-fluid">
			<div class="navbar-header">
				<button type="button" class="navbar-toggle" data-toggle="collapse"
					data-target=".navbar-collapse">
					<span class="sr-only">Toggle navigation</span> <span
						class="icon-bar"></span> <span class="icon-bar"></span> <span
						class="icon-bar"></span>
				</button>
				<a class="navbar-brand text-warning" href="#">Transportation
					Data Analysis</a>
			</div>
			<div class="navbar-collapse collapse">
				<ul class="nav navbar-nav navbar-right">
					<li><a href="#">Hi,&nbsp;${username}, you are login as
							${role}</a></li>
					<li><a
						href="${pageContext.request.contextPath}/j_spring_security_logout">Log
							Out</a></li>
				</ul>

			</div>
		</div>
	</div>
	<div class="container-fluid">
		<div class="row">
			<div class="col-sm-3 col-md-2 sidebar">
				<ul class="nav nav-pills nav-stacked">
					<sec:authorize access="hasRole('ADMIN')">
						<li><a
							href="${pageContext.request.contextPath}/home/configuration">Configuration</a></li>
					</sec:authorize>
					<sec:authorize access="hasRole('ADMIN') or hasRole('OPT')">
						<li><a
							href="${pageContext.request.contextPath}/home/newPadding">New
								Paddings</a></li>
					</sec:authorize>

					<sec:authorize access="hasRole('ADMIN') or hasRole('CONFIG')">
						<li><a
							href="${pageContext.request.contextPath}/home/readyPadding">Ready
								Paddings</a></li>
					</sec:authorize>

					<sec:authorize
						access="hasRole('ADMIN') or hasRole('CONFIG') or hasRole('OPT')">
						<li><a
							href="${pageContext.request.contextPath}/home/exsitPadding">Exsit
								Paddings</a></li>

					</sec:authorize>

					<sec:authorize
						access="hasRole('ADMIN') or hasRole('CONFIG') or hasRole('OPT') or  hasRole('SUPER')">
						<li><a
							href="${pageContext.request.contextPath}/home/fcAnalysis">Impact
								Analysis (FC)</a></li>
					</sec:authorize>

					<sec:authorize
						access="hasRole('ADMIN') or hasRole('CONFIG') or hasRole('OPT') or  hasRole('SUPER')">
						<li><a
							href="${pageContext.request.contextPath}/home/carrierAnalysis">Impact
								Analysis (Carrier)</a></li>
					</sec:authorize>
					<sec:authorize
						access="hasRole('ADMIN') or hasRole('CONFIG') or hasRole('OPT') or  hasRole('SUPER')">
						<li><a
							href="${pageContext.request.contextPath}/home/locationAnalysis">Impact
								Analysis (Location)</a></li>
					</sec:authorize>
					<sec:authorize
						access="hasRole('ADMIN') or hasRole('CONFIG') or hasRole('OPT') or  hasRole('SUPER')">
						<li><a
							href="${pageContext.request.contextPath}/home/summaryAnalysis">Impact
								Analysis (Summary)</a></li>
					</sec:authorize>
					<sec:authorize access="hasRole('ADMIN') ">
						<li><a href="${pageContext.request.contextPath}/home/user">Users</a></li>
					</sec:authorize>
				</ul>
			</div>

			<div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
				<jsp:include page="${nav}.jsp"></jsp:include>
			</div>
		</div>
	</div>
	<jsp:include page="common/tail.jsp"></jsp:include>
</body>
</html>
